package com.dream.myqiyi.service.impl;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.dream.myqiyi.dao.NoteModel;
import com.dream.myqiyi.service.NoteManager;
import com.j256.ormlite.dao.Dao;

public class NoteManagerImpl  extends GenericManagerImpl<NoteModel, String> implements NoteManager {
	Dao<NoteModel, String> noteDao;
	
	public NoteManagerImpl(Dao<NoteModel, String> noteDao) {
        super(noteDao);
        this.noteDao = noteDao;
    }

	public List<NoteModel> getAllFavorite() {
		return getAll();
	}
	
	public List<NoteModel> findByNotebookGuid(String notebookGuid) {
		Map<String, Object> filedValues = new HashMap<String, Object>(); 
		filedValues.put("notebookGuid", notebookGuid);
		try {
			return noteDao.queryForFieldValues(filedValues);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;	
	}

}
